﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace WP7Client.Classes
{
    public class SearchFilter
    {
        private Boolean isFilterValid = false;

        private String mobilePhoneNumber;
        private String firstname;
        private String surname;
        private String city;
        private String age;
        private String username;

        /// <summary>
        /// Creëert een nieuw zoekfilter
        /// </summary>
        public SearchFilter()
        {

        }

        public String MobilePhoneNumber
        {
            get { return mobilePhoneNumber; }
            set { mobilePhoneNumber = value; CheckIfValid(); }
        }

        public String Firstname
        {
            get { return firstname; }
            set { firstname = value; CheckIfValid(); }
        }

        public String Surname
        {
            get { return surname; }
            set { surname = value; CheckIfValid(); }
        }

        public String City
        {
            get { return city; }
            set { city = value; CheckIfValid(); }
        }

        public String Username
        {
            get { return username; }
            set { username = value; CheckIfValid(); }
        }

        public String Age
        {
            get { return age; }
            set { age = value; CheckIfValid(); }
        }

        /// <summary>
        /// Controleert of de filter valide is
        /// </summary>
        private void CheckIfValid()
        {
            IsFilterValid = !(String.IsNullOrEmpty(mobilePhoneNumber) && String.IsNullOrEmpty(firstname) && String.IsNullOrEmpty(surname)
                 && String.IsNullOrEmpty(city) && String.IsNullOrEmpty(age) && String.IsNullOrEmpty(username));
        }

        public Boolean IsFilterValid
        {
            get { return isFilterValid; }
            set { isFilterValid = value; }
        }
    }
}
